package com.iknowone.servlet;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.iknowone.db.DbManager;
import com.iknowone.entity.Poi;
import com.iknowone.entity.Result;
import com.iknowone.entity.Status;

public class SearchServlet extends BaseServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected Result getResult(HttpServletRequest req) {
		DbManager dbManager = new DbManager();
		String what = req.getParameter("whattype");
		String catId = req.getParameter("catId");
		String text = req.getParameter("text");
		String where = req.getParameter("where");

		String sort = req.getParameter("sort");
		String filter = req.getParameter("filter");
		List<Poi> pois = dbManager.search(text);
		Status status = new Status(HttpServletResponse.SC_OK, "Succes");
		return new Result(pois, status);
	}

}